﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace Pg.BioMedics.SDR.Web.Services
{
    /// <summary>
    /// Application class exception used for service proxy errors 
    /// wrapping.
    /// </summary>
    public class SDRWebServiceException : ApplicationException
    {
        #region Constructor

        /// <summary>
        /// Creates instance of ServiceProxyException without initialization
        /// </summary>
        internal SDRWebServiceException()
            : base() { }

        /// <summary>
        /// Creates instance of ServiceProxyException initialized with error message
        /// </summary>
        /// <param name="message">Exception message</param>
        internal SDRWebServiceException(string message)
            : base(message) { }

        /// <summary>
        /// Creates instance of ServiceProxyException initializ with formatted
        /// error message
        /// </summary>
        /// <param name="messageFormat">Message format template</param>
        /// <param name="parameters">Message parameters</param>
        internal SDRWebServiceException(string messageFormat, params object[] parameters)
            : base(String.Format(messageFormat, parameters)) { }

        /// <summary>
        /// Creates instance of ServiceProxyException wrapping inner exception
        /// </summary>
        /// <param name="message">Exception message</param>
        /// <param name="innerException">Wrapped exception instance</param>
        internal SDRWebServiceException(string message, Exception innerException)
            : base(message, innerException) { }

        /// <summary>
        /// Creates instance of ServiceProxyException wrapping inner exception
        /// with formatted message
        /// </summary>
        /// <param name="messageFormat">Message format template</param>
        /// <param name="innerException">Wrapped inner exception instance</param>
        /// <param name="parameters">Message template parameters</param>
        internal SDRWebServiceException(string messageFormat, Exception innerException, params object[] parameters)
            : base(String.Format(messageFormat, parameters), innerException) { }

        #endregion
    }
}
